#ifndef LINKEDLIST_H
#define LINKEDLIST_H

#include <iostream>
template <typename T>
struct Node
{
    T num;
    T mi;
    Node<T> *next;
};

template <typename T>
class LinkedList
{
public:
    Node<T> *head;
    Node<T> *tail;
    int size;

    LinkedList()
    {
        head = NULL;
        tail = NULL;
        size = 0;
    }

    void push(T data, T mi)
    {
        Node<T> *temp = new Node<T>;
        temp->num = data;
        temp->mi = mi;
        temp->next = NULL;
        if (head == NULL)
        {
            head = temp;
            tail = temp;
            size++;
        }
        else
        {
            tail->next = temp;
            tail = temp;
            size++;
        }
    }

    void pop()
    {
        if (head == NULL)
        {
            return;
        }
        else
        {
            Node<T> *temp = head;
            head = head->next;
            delete temp;
        }
    }
    void Print()
    {
        Node<T> *current = head;
        while (current != NULL)
        {

            std::cout << current->num << " " << current->mi << std::endl;

            current = current->next;
        }
    }
};

#endif // LINKEDLIST_H